package cn.edu.ctbu.sbadmin.system.dao;


import cn.edu.ctbu.sbadmin.common.core.MyMapper;
import cn.edu.ctbu.sbadmin.system.domain.RoleDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 系统角色：
 *
 * @author tms
 * @date 2018-02-04
 */
@Mapper
public interface RoleDao extends MyMapper<RoleDO> {


    /**
     * 取指定roleName对应的多条记录
     *
     * @param roleName
     * @return
     */
    @Select(" select\n" +
            "        `id`,`role_name`,`role_sign`,`remark`,`user_id_create`,`gmt_create`,`gmt_modified`,`is_deleted`,`gmt_delete`,`delete_userid`\n" +
            "        from sys_role\n" +
            "        where role_name = #{value}\n" +
            "        and  is_deleted < 1")
    List<RoleDO> findByRoleName(String roleName);

    /**
     * 取指定roleSign对应的多条记录
     *
     * @param roleSign
     * @return
     */
    @Select(" select\n" +
            "        `id`,`role_name`,`role_sign`,`remark`,`user_id_create`,`gmt_create`,`gmt_modified`,`is_deleted`,`gmt_delete`,`delete_userid`\n" +
            "        from sys_role\n" +
            "        where role_sign = #{value}\n" +
            "        and  is_deleted < 1")
    List<RoleDO> findByRoleSign(String roleSign);



}
